<!-- OPTIMIZE: Slow load. Possible on file search. Need to check. -->

   <H1><%= @composite_soa.name %> ICD</H1>

   <OL>
      
       <LI>
	 <H2>Introduction</H2>
<OL>
  <LI>
	<H3>Disclaimer</H3>
  <P>DIRECTV makes no
representations, express or implied, that use of the technologies
described in this specification will not infringe patents,
copyrights, or other intellectual property rights of third parties.
Nothing in this specification should be construed as granting
permission to use any of the technologies described. Anyone planning
to make use of technology covered by the intellectual property rights
of others should first obtain permission from the holder(s) of the
rights. This specification is subject to change without notice.
DIRECTV does not accept any responsibility whatsoever for damages or
liability, direct or consequential, which may result from use of this
specification or any related discussions.</P>
  <LI>
	<H3>Scope</H3>
<P>
The Scope of this
document is to provide high level design for <%= @composite.name %> service
as the part of AMP infrastructure which is the base platform in BBVOD
project.</P>
<P>
This document is
intended for DIRECTV development and engineering groups developing or
using services in BBVOD project on AMP.</P>  
  
	        <LI>
	 <H3>Overview</H3>
	 <P><%= simple_format @composite.description %></P>
	 <% image_path = "/serve_image/"+@composite.name+"?filename="+@composite.name+"_composite&format=png" %>
	 <P><%= image_tag image_path, alt: "The image path in doc folder is empty. Name must be '[composite name]_composite.png'", width: '800' %></P>


</OL>
	 

       <LI>
	 <H2>Interface Definition</H2>
	 <OL>


	 <LI>
	   <H3>Communication Protocol</H3>
	   
<P><%= @composite.name %> SOA composite project. Composite contain one or more components, can expose services and communicate with external systems via declared references.</P>

<P>Services exposes WSDL interface and use SOAP as a communication protocol.</P>

	 <LI>
	   <H3>SOA composite Web Service Interface</H3>
	   
<P><%= @composite.name %> exposes its functionality via Web Service interface Endpoint:</P>
<P></P>
<P><I><%= "http://wls-host:port/[geo]/soa-infra/services/" + @composite_soa.domain_name + "/" + @composite_soa.name + "[!version]" %></I></P>
<P></P>
<P>The [geo] optional and not present by default.</P>
<P>The [version] optional and not present by default.</P>
<P></P>
<P></P>
<P>Refer to the AMP Naming Convention Document for details.</P>
<P></P>
</OL>

<!-- Services	-->
	 <LI>
	   <H3>Exposed Services</H3>
	   <OL>
	     <%- @services.each do |service| -%>
	       
	     <LI>
	       <H4>
	       <%= link_to service.name, edit_service_path(service)  %> endpoint
	       </H4>
	       <P>
	       <I>
		 <%= simple_format service.description %>
		 </I>
	       </P>
	       
	       <P>Type: 
	       <I>
		 <%= service.binding_type %>
		 </I>
	       </P>
	       <P>Abstract WSDL location: 
	       <I>
		 <%= url_mask(service.location_abstract)%>
		 </I>
	       </P>
	       
	    <%- if !service.location.nil? and !service.location.empty?  -%>
	       <P>Location: 
	       <I>
		 <%= url_mask(service.location) %>
		 </I>
	       </P>
	    <%- end -%>
	       
	      
<% @wsdl = Wsdl.new(xml_resource_path(service.location_abstract)) %>

	   <OL>
<%- if !@wsdl.nil? -%>

<% @wsdl.operations.each do |operation| %>
	     <LI>
	       <H4>
	       <%= operation["name"] %> operation
	       </H4>
	       <P>
	       <I>
		 <%= simple_format @wsdl.documentation(operation) %>
		 </I>
	       </P>

<DL>
	<DD>
	<TABLE WIDTH=90% CELLPADDING=7 CELLSPACING=0>
		<TR>
			<TD BGCOLOR="#c6d9f1" STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=2 STYLE="font-size: 11pt"><B>Message name</B></FONT></FONT></P>
			</TD>
			<TD BGCOLOR="#c6d9f1" STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=2 STYLE="font-size: 11pt"><B>Message type</B></FONT></FONT></P>
			</TD>
			<TD BGCOLOR="#c6d9f1" STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=2 STYLE="font-size: 11pt"><B>Message element</B></FONT></FONT></P>
			</TD>
			<TD BGCOLOR="#c6d9f1" STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=2 STYLE="font-size: 11pt"><B>Message Schema</B></FONT></FONT></P>
			</TD>
			<TD BGCOLOR="#c6d9f1" STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=2 STYLE="font-size: 11pt"><B>Used Schemas</B></FONT></FONT></P>
			</TD>
		</TR>
<% @wsdl.messages(operation).each do |message|%>
		<TR VALIGN=TOP>
			<TD STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=3>
				  <%= message["message"].split(":").size>1 ? message["message"].split(":")[1] : message["message"] %>
				  </FONT></FONT></P>
			</TD>
			<TD STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=3>
				  <%= message.name %>
				  </FONT></FONT></P>
			</TD>
			<TD STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western"><FONT FACE="Book Antiqua, serif"><FONT SIZE=3>
				  <% begin %>
				  <%= @wsdl.qname(@wsdl.message_element(message).text) %>
				  <% rescue %>
				  <% end %>
				  </FONT></FONT></P>
			</TD>
			<TD STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western" ALIGN=LEFT><FONT FACE="Book Antiqua, serif"><FONT SIZE=3>
				  <% begin %>
				  <%= @wsdl.element_schema(@wsdl.message_element(message).value) %>
				  <% rescue Exception => e %>
<!-- 				  <%= "Error: " %> -->
<!-- 				  <%= e %> -->
				  <% end %>
				  </FONT></FONT></P>
			</TD>
			<TD STYLE="border: 1px solid #00000a; padding: 0cm 0.19cm">
				<P CLASS="western" ALIGN=LEFT><FONT FACE="Book Antiqua, serif"><FONT SIZE=3>
				  <% begin %>
				  <%= @wsdl.imports.collect{|s| s["schemaLocation"] } %>
				  <% rescue %>
				  <% end %>
				  </FONT></FONT></P>
			</TD>
<%- end -%>
		</TR>
	</TABLE>
</DL>
<%- end -%>
<%- end -%>
</OL>

<BR>
<P></P>

<P>WSDL definition:</P>	      
<TABLE WIDTH=742 CELLPADDING=7 CELLSPACING=0>
	<COL WIDTH=728>
	<TR>
		<TD WIDTH=728 VALIGN=TOP STYLE="border: none; padding: 0cm">
			<P CLASS="western" ALIGN=LEFT STYLE="margin-left: 0cm; margin-top: 0cm">
			<FONT FACE="Book Antiqua, serif"><FONT COLOR="#008080"><FONT FACE="Courier New, serif"><FONT SIZE=2 STYLE="font-size: 9pt">
<textarea name="wsdl" cols="180" rows="<%= @wsdl.doc.elements[0].to_xml.lines.count+5 %>" readonly>
<%= @wsdl.doc.elements[0].to_xml %>
  </textarea>

			  </FONT></FONT></FONT></FONT></P>
		</TD>
	</TR>
</TABLE>

	    <%- end -%>
<!-- Services	-->
	 
</OL>
<P></P>
  
  <br/>
  <br/>
  <br/>